package com.nmf.site.common.enums;

import com.nmf.site.common.excep.SiteException;

public enum OrderType {
	PICKUPORDER(1, "接机"),
	TRANSFER(2, "送机"),
	DAILY(3, "包车"),
	PERUSE(4, "单次接送"),
;

	public Integer value;
	public String name;

	OrderType(int value, String name) {
		this.value = value;
		this.name = name;
	}

	public static OrderType getType(Integer value) {
		OrderType[] otypes = OrderType.values();
		for (OrderType orderType : otypes) {
			if (orderType.value.equals(value)) {
				return orderType;
			}
		}
		throw new SiteException(value+"不存在");
	}

	public boolean valueEquals(Integer value){
		return this.value.equals(value);
	}
}
